home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d1
/
batchlrn.arc
/
IFEXIST.HLP
< prev
next >
Wrap
Text File
|
1991-06-17
|
3KB
|
47 lines
#
#
|---------------B A T C H L R N H E L P S Y S T E M-----------------|
|command: IF EXIST |
|use: The IF EXIST cmnd. allows CONFIRMATION of a file or condition. |
| |
|how: Type:IF EXIST <filename.ext> or <condition> [then] <cmnd.> O-R |
| IF NOT EXIST <same as above> |
| |
|example: IF EXIST %1 GOTO EXISTS |
| ECHO . . . T H E F I L E D O E S N ' T E X I S T ! |
| :EXISTS |
| ECHO ...%1 IS AN EXISTING FILE IN THE CURRENT DIRECTORY! |
| |
| If you were to type:"EXIST SWELL.TXT" and it DID NOT EXIST the |
| statement would be FALSE and the batch file would move to the next |
| line, displaying: ...THE FILE DOES NOT EXIST! If you typed the same |
| phrase, and the file WAS in the CURRENT directory the statement |
| would be true and the batch file would JUMP to the label "EXISTS". |
| It would then display the message: ...SWELL.TXT [that's the %1] IS |
| AN EXISTING FILE IN THE CURRENT DIRECTORY! Using this basic shell |
| you can create many IF EXIST batch processing files to make your |
| work easier. FOR CROSS-REFERENCE SEE THE IF.HLP FILE! |
|NOTES: When <condition> is TRUE, DOS or batch <command> is performed.|
| When <condition> is NOT TRUE,the <command> is IGNORED and the next |
| line in the batch processing file is performed. |
| The<condition> we are "testing" here, IF EXIST o-r NOT EXIST is ill-|
| illustrated by these two examples: |
| |
| IF EXIST = True if and only if <filename> exists. |
| |
| IF NOT EXIST = True if and only if <condition> is false. |
| |
| Another example of IF EXIST (>Condition 3) is as follows: |
| >Condition 3:The logical test for checking for the existence of a |
| file has as its format: EXIST C:<filename.ext> |
| You can use this test to check and see if a file is in C: drive |
| (as in the example). EXIST B:<filename.ext> might be used to check |
| to see if B: drive has a DOS disk in the drive. Explore other uses |
| after examining files on this disk with "EXIST". Note: you cannot |
| use pathnames for checking on a file's existence. |
| |
|READER NOTE:The IF & IF EXIST cmnds are important to you. Review THIS|
| file & IF.HLP,then s-t-u-d-y the "EXIST".BAT files.YOU'LL HAVE IT! |
| |
|----------------- T I M E M A S T E R ---------------------|